//
//  RefreshControl.swift
//  Venus
//
//  Created by qurongxiang on 2018/9/8.
//  Copyright © 2018年 zhaowang. All rights reserved.
//

import UIKit
import MJRefresh

@objc protocol RefreshControl {
    @objc func refreshingAction(refreshControl:MJRefreshNormalHeader)
    @objc func refreshingActionFooter(refreshControl:MJRefreshAutoNormalFooter)
}

extension RefreshControl {
    func setupRefreshControl(scrollView:UIScrollView,target:AnyObject!) {
        let header = MJRefreshNormalHeader(refreshingTarget: target, refreshingAction: #selector(refreshingAction(refreshControl:)))
        scrollView.mj_header = header
    }
    
    func setupRefreshFootControl(scrollView:UIScrollView,target:AnyObject!) {
        let footer = MJRefreshAutoNormalFooter(refreshingTarget: target, refreshingAction: #selector(refreshingActionFooter(refreshControl:)))
        scrollView.mj_footer = footer
    }
    
}
